package one.stand.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import one.stand.aop.ApiController;
import one.stand.model.ResultModel;
import one.stand.request.CompanyCouponRequest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: QIK
 * @CreateDate: 2019/6/24 15:42
 */
@RestController
@RequestMapping("crmPc/company/coupon")
@Api(description = "企业优惠券管理")
public class CompanyCouponController extends BaseController {

    /**
     * 创建优惠券
     * @param request
     * @return
     */
    @ApiOperation(value = "创建优惠券")
    @ApiController(isLogin = true,isBoss = true,paramClass = CompanyCouponRequest.class)
    @PostMapping("add")
    public  ResultModel<Boolean> add(@RequestAttribute CompanyCouponRequest request){
       return crmFegin.add(request);
    }

    /**
     * 修改优惠券
     * @param request
     * @return
     */
    @ApiOperation(value = "修改优惠券")
    @ApiController(isLogin = true,isBoss = true,paramClass = CompanyCouponRequest.class)
    @PostMapping("upd")
    public ResultModel<Boolean> upd(@RequestAttribute CompanyCouponRequest request){
        return crmFegin.upd(request);
    }


    /**
     * 删除优惠券
     * @param request
     * @return
     */
    @ApiOperation(value = "删除优惠券")
    @ApiController(isLogin = true,isBoss = true,paramClass = CompanyCouponRequest.class)
    @PostMapping("del")
    public  ResultModel<Boolean> del(@RequestAttribute CompanyCouponRequest request){
        return crmFegin.del(request);
    }
    /**
     * 删除优惠券
     * @param request
     * @return
     */
    @ApiOperation(value = "优惠券列表")
    @ApiController(isLogin = true,isBoss = true,paramClass = CompanyCouponRequest.class)
    @PostMapping("crmPcPageList")
    public  ResultModel crmPcPageList(@RequestAttribute CompanyCouponRequest request){
        return crmFegin.crmPcPageList(request);
    }
}
